﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace MS_UI
{


   
    internal class DataValidate
    {

        /// <summary>
        /// 验证整数
        /// </summary>

        public static bool IsInteger(string txt)
        {
            Regex objReg = new Regex(@"^[1-9]\d*s");
            return objReg.IsMatch(txt);

        }

        /// <summary>
        /// 验证是否是Emile
        /// </summary>

        public static bool IsEmail(string txt)
        {
            Regex objReg = new Regex(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([+.]\w+)");
            return objReg.IsMatch(txt);

        }

        /// <summary>
        /// 验证是否是Emile
        /// </summary>
        /// 

        public static bool IsIdentityCard(string txt)
        {
            Regex objReg = new Regex(@"^(\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$");
            return objReg.IsMatch(txt);

        }
    }
}
